package com.heima.controller;

import com.heima.pojo.entity.Role;
import com.heima.service.RoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * \* User: chy
 * \* Date: 2025/8/22  21:50
 * \* Description:
 * \
 */
@RestController
@RequestMapping("/api/user-service/role")
public class RoleController {

    @Autowired
    private RoleService roleService;

    /**
     * 查询所有角色
     * @return
     */
    @GetMapping
    public List<Role> search() {
        List<Role> roleList = roleService.list();
        return roleList;
    }
}
